/* Load Calculator Basic - Generator Load Estimator (aligned with unified UX spec) */

.load-basic-calc {
  /* Load Basic heading tokens (calculator-local) */
  --lb-section-heading-size: 1.1em;
  --lb-section-heading-weight: 600;
  --lb-section-heading-line-height: 1.3;
  --lb-section-heading-color: #495057;
}

.load-basic-calc h1,
.load-basic-calc h2,
.load-basic-calc h3 {
  margin: 0 0 10px;
}

.load-basic-calc h1 { font-size: 1.6rem; }
.load-basic-calc h2 { font-size: 1.2rem; margin-top: 24px; }

.load-basic-calc .app {
  max-width: 1300px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Banner – match Water Calculator */
.load-basic-calc .banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #1e40af 100%);
  color: white;
  padding: 24px 30px;
  text-align: center;
}

.load-basic-calc .banner-title {
  font-size: 1.75em;
  margin: 0 0 8px;
  font-weight: 600;
}

.load-basic-calc .banner-subtitle {
  font-size: 1.4em;
  font-weight: bold;
  opacity: 0.95;
  margin: 0;
}

.load-basic-calc .version-info {
  font-size: 0.85em;
  opacity: 0.85;
  margin: 4px 0 0;
}

/* Primary toolbar – suite alignment (Load Calc Pro / Water) */
.load-basic-calc .toolbar-wrap {
  padding: 12px 24px 8px;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}

.load-basic-calc .toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.load-basic-calc .toolbar .btn {
  padding: 8px 12px;
  font-size: 0.85em;
}

.load-basic-calc .toolbar #btn-clear-autosave {
  margin-right: 0;
}

.load-basic-calc .toolbar-last-saved {
  font-size: 0.8em;
  color: #6b7280;
  white-space: nowrap;
  margin-left: 8px;
  margin-right: auto;
}

.load-basic-calc .content-wrap {
  padding: 20px 24px 28px;
}

/* Buttons – suite alignment: same size, radius 6px, no border, same colors as Pro/Water */
.load-basic-calc .btn {
  padding: 10px 16px;
  font-size: 0.9em;
  border-radius: 6px;
  border: none;
  background: #f9fafb;
  color: #111827;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.load-basic-calc .btn:hover { background: #e5e7eb; }

.load-basic-calc .btn-primary {
  background: #2563eb;
  color: #fff;
}
.load-basic-calc .btn-primary:hover { background: #1d4ed8; }

.load-basic-calc .btn-print {
  background: #2563eb;
  color: #fff;
}
.load-basic-calc .btn-print:hover { background: #1d4ed8; }

.load-basic-calc .btn-save,
.load-basic-calc .btn-load {
  background: #10b981;
  color: #fff;
}
.load-basic-calc .btn-save:hover,
.load-basic-calc .btn-load:hover { background: #059669; }

.load-basic-calc .btn-success {
  background: #10b981;
  color: #fff;
}

.load-basic-calc .btn-delete {
  background: #f59e0b;
  color: #fff;
}
.load-basic-calc .btn-delete:hover { background: #d97706; }

.load-basic-calc .btn-clear {
  background: #ef4444;
  color: #fff;
}
.load-basic-calc .btn-clear:hover { background: #dc2626; }

.load-basic-calc .btn-secondary {
  background: #6b7280;
  color: #fff;
}
.load-basic-calc .btn-secondary:hover { background: #4b5563; }

.load-basic-calc .btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.load-basic-calc .btn-delete-row {
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}
.load-basic-calc .btn-delete-row:hover { background: #fecaca; border-color: #ef4444; }

/* Scenario section – green box aligned with Medicines/Consumables */
.load-basic-calc .scenario-section {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: #ecfdf5;
  border-radius: 8px;
  border: 2px solid #059669;
}

/* Tighter vertical rhythm inside Scenarios only (screen + print) */
.load-basic-calc .scenario-section .section-heading-row {
  margin-bottom: 6px;
}

.load-basic-calc .scenario-section .scenario-section-title {
  margin: 0 0 8px 0;
}

.load-basic-calc .scenario-section-title {
  margin: 0 0 12px 0;
  font-size: var(--lb-section-heading-size);
  font-weight: var(--lb-section-heading-weight);
  line-height: var(--lb-section-heading-line-height);
  color: #495057;
}

/* Explicit shared heading class for non-sidebar section titles */
.load-basic-calc .lb-section-heading {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--lb-section-heading-size);
  font-weight: var(--lb-section-heading-weight);
  line-height: var(--lb-section-heading-line-height);
  letter-spacing: 0;
  color: var(--lb-section-heading-color);
}

/* Deterministic match for the two user-facing section headers */
.load-basic-calc #lb-heading-scenarios,
.load-basic-calc #lb-heading-equipment {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: var(--lb-section-heading-size) !important;
  font-weight: var(--lb-section-heading-weight) !important;
  line-height: var(--lb-section-heading-line-height) !important;
  letter-spacing: 0 !important;
  color: var(--lb-section-heading-color) !important;
}

.load-basic-calc .scenario-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.load-basic-calc .load-scenario-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
}

.load-basic-calc .scenario-select {
  padding: 7px 9px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.85em;
  box-sizing: border-box;
  min-width: min(120px, 100%);
  max-width: min(280px, 100%);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
}

.load-basic-calc .scenario-actions .btn {
  padding: 8px 12px;
  font-size: 0.85em;
}

.load-basic-calc .scenario-storage-note {
  font-size: 0.8em;
  color: #6b7280;
  margin: 0 0 8px;
  font-style: italic;
}

.load-basic-calc .scenario-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.load-basic-calc .scenario-meta .field-notes { grid-column: 1 / -1; }

.load-basic-calc .scenario-meta .field {
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
}

.load-basic-calc .scenario-meta .field label {
  display: block;
  margin-bottom: 3px;
  font-size: 0.8rem;
  color: #374151;
  font-weight: 600;
}

.load-basic-calc .scenario-saved-line {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #374151;
}

.print-timestamp {
  display: none;
}

.load-basic-calc .section-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.load-basic-calc .section-heading-row h2,
.load-basic-calc .section-heading-row h3 { margin: 0; }

.load-basic-calc .equipment-list-heading {
  padding: 10px 20px 0;
}

.load-basic-calc .equipment-list-heading .scenario-section-title {
  margin: 0;
}

.load-basic-calc .help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #2563eb;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.load-basic-calc .help-icon:hover,
.load-basic-calc .help-icon[aria-expanded="true"] {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.load-basic-calc .help-popover {
  padding: 12px 14px;
  background: rgba(241, 245, 249, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  color: #1e293b;
  max-width: 420px;
  margin-bottom: 12px;
}

.load-basic-calc .help-popover[hidden] { display: none !important; }
.load-basic-calc .help-popover ul { margin: 0; padding-left: 1.2em; }
.load-basic-calc .help-popover li { margin-bottom: 6px; }
.load-basic-calc .help-popover li:last-child { margin-bottom: 0; }
.load-basic-calc .toolbar-wrap > .help-popover {
  margin-top: 8px;
}

/* Sort bar */
.load-basic-calc .sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.load-basic-calc .sort-bar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.load-basic-calc .sort-select {
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  min-width: 160px;
}

.load-basic-calc .search-wrap {
  padding: 0 24px 12px;
  background: #fff;
}

.load-basic-calc .search-box {
  width: 100%;
  min-width: 200px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1em;
  margin-bottom: 0;
  background: white;
}

.load-basic-calc .search-box::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.load-basic-calc .equipment-row.search-hidden {
  display: none;
}

.load-basic-calc .field {
  display: block;
}

.load-basic-calc .field label,
.load-basic-calc .field .label {
  display: block;
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 4px;
}

.load-basic-calc .field input[type="text"],
.load-basic-calc .field input[type="number"],
.load-basic-calc .field textarea,
.load-basic-calc .field select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
}

.load-basic-calc .field input[type="number"].qty { width: 70px; text-align: right; }

.load-basic-calc .field textarea {
  min-height: 60px;
  resize: vertical;
}

/* Scenarios notes: slightly shorter default than other textareas; user can still resize */
.load-basic-calc .scenario-meta .field textarea {
  min-height: 52px;
  line-height: 1.35;
}

.load-basic-calc input:hover,
.load-basic-calc textarea:hover,
.load-basic-calc select:hover {
  outline: 2px solid rgba(59,130,246,0.4);
  outline-offset: -2px;
}

.load-basic-calc input:focus,
.load-basic-calc textarea:focus,
.load-basic-calc select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  border-color: #3b82f6;
}

.load-basic-calc .input-placeholder-zero { color: #9ca3af !important; }
.load-basic-calc .input-with-unit input::placeholder,
.load-basic-calc .equipment-table input::placeholder { color: #9ca3af; opacity: 1; }

.load-basic-calc .input-with-unit {
  display: flex;
  align-items: center;
  gap: 4px;
}

.load-basic-calc .input-with-unit span { font-size: 0.8rem; color: #6b7280; }

/* Validation */
.load-basic-calc input.input-error,
.load-basic-calc .equipment-table input.input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.load-basic-calc .validation-error {
  display: none;
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 2px;
  font-weight: 500;
}
.load-basic-calc .equipment-row td .validation-error { margin-top: 2px; }

/* Main grid: categories | sidebar */
.load-basic-calc .main-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.load-basic-calc .categories-wrap { }

/* Category blocks */
.load-basic-calc .category {
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  overflow: hidden;
}

.load-basic-calc .category-head {
  padding: 8px 10px;
  background: #f3f4f6;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.load-basic-calc .category-head:hover { background: #e5e7eb; }

.load-basic-calc .category-title { display: flex; align-items: center; gap: 8px; }

.load-basic-calc .chevron {
  transition: transform 0.2s ease;
  font-size: 0.7rem;
}

.load-basic-calc .category.collapsed .chevron { transform: rotate(-90deg); }

/* Standalone: root is .app, not .load-basic-calc */
.app .category-head { cursor: pointer; }
.app .category-head:hover { background: #e5e7eb; }
.app .category.collapsed .category-body { display: none; }
.app .category.collapsed .chevron { transform: rotate(-90deg); }

.load-basic-calc .category-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.load-basic-calc .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.load-basic-calc .category-body { padding: 6px 10px 8px; }

.load-basic-calc .category.collapsed .category-body { display: none; }

.load-basic-calc .add-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.load-basic-calc .add-row input { margin: 0; }

/* Tables */
.load-basic-calc .equipment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.load-basic-calc .equipment-table th,
.load-basic-calc .equipment-table td {
  padding: 4px;
  text-align: left;
}

.load-basic-calc .equipment-table th {
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.load-basic-calc .equipment-table td { border-bottom: 1px solid #f3f4f6; }

.load-basic-calc .equipment-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.load-basic-calc .equipment-table .col-delete { text-align: center; width: 1%; }

/* Sidebar cards */
.load-basic-calc .sidebar h2 { margin-top: 14px; }
.load-basic-calc .sidebar h2:first-child { margin-top: 0; }

.load-basic-calc .card {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.load-basic-calc .summary-card {
  border: 1px solid #93c5fd;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 8px 18px rgba(59,130,246,0.15);
}

.load-basic-calc .capacity-card {
  border: 1px solid #fbbf24;
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  box-shadow: 0 8px 18px rgba(245,158,11,0.18);
}

.load-basic-calc .fuel-card {
  border: 1px solid #34d399;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  margin-top: 14px;
}

.load-basic-calc .card .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.load-basic-calc .card .row:last-of-type { margin-bottom: 0; }

.load-basic-calc .card .label { color: #1f2937; }
.load-basic-calc .card .value { font-weight: 700; }
.load-basic-calc .card .value-lg { font-size: 1.2rem; }

.load-basic-calc .capacity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.load-basic-calc .status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.load-basic-calc .status-ok { background: #bbf7d0; color: #14532d; border: 1px solid #22c55e; }
.load-basic-calc .status-warn { background: #fed7aa; color: #7c2d12; border: 1px solid #ea580c; }
.load-basic-calc .status-danger { background: #fecaca; color: #7f1d1d; border: 1px solid #dc2626; }
.load-basic-calc .status-muted { background: #e5e7eb; color: #374151; border: 1px solid #d1d5db; }

.load-basic-calc .capacity-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.load-basic-calc .note {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 6px;
}

.load-basic-calc .color-ok { color: #22c55e; font-weight: 700; }
.load-basic-calc .color-warn { color: #ea580c; font-weight: 700; }
.load-basic-calc .color-danger { color: #dc2626; font-weight: 700; }

/* Footer (unified spec: disclaimer) */
.load-basic-calc .footer.disclaimer {
  margin: 0;
  padding: 14px 24px;
  font-size: 0.75rem;
  color: #6b7280;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.load-basic-calc .last-saved {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #6b7280;
}

.load-basic-calc .version-label {
  display: block;
  font-size: 0.75em;
  color: #d1d5db;
  margin-top: 4px;
  text-align: center;
}

/* Toast */
.load-basic-calc .toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.load-basic-calc .toast {
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  min-width: 200px;
  max-width: 300px;
  animation: toast-in 0.3s ease-out;
}

.load-basic-calc .toast-success { background: #22c55e; }
.load-basic-calc .toast-info { background: #3b82f6; }
.load-basic-calc .toast-warning { background: #f59e0b; }
.load-basic-calc .toast-error { background: #dc2626; }

.load-basic-calc .toast.fade-out { animation: toast-out 0.3s ease-in forwards; }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Export format dialog (radio choice) */
.load-basic-calc .export-format-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.load-basic-calc .export-format-dialog[hidden] { display: none !important; }
.load-basic-calc .export-format-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 18px 22px;
  min-width: 280px;
}
.load-basic-calc .export-format-title { margin: 0 0 12px; font-size: 1rem; font-weight: 600; }
.load-basic-calc .export-format-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.load-basic-calc .export-format-option {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
}
.load-basic-calc .export-format-option input { margin: 0; }
.load-basic-calc .export-format-hint { font-size: 0.85em; color: #6b7280; }
.load-basic-calc .export-format-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Print */
@media print {
  @page { size: letter; margin: 0; }
  .load-basic-calc .app { box-shadow: none; }
  .load-basic-calc .banner {
    background: white;
    color: black;
    padding: 8px 12px;
    text-align: center;
  }
  .load-basic-calc .banner-title,
  .load-basic-calc .banner-subtitle { color: black; }
  .load-basic-calc .banner-title {
    font-size: 1.35rem;
    margin: 0 0 2px;
  }
  .load-basic-calc .banner-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 1;
  }
  /* Less padding above Scenarios on print */
  .load-basic-calc .content-wrap {
    padding: 10px 12px 14px;
  }
  /* Standalone: .app without .load-basic-calc wrapper */
  .app .banner {
    background: white;
    color: black;
    padding: 8px 12px;
    text-align: center;
  }
  .app .banner-title,
  .app .banner-subtitle { color: black; }
  .app .banner-title {
    font-size: 1.35rem;
    margin: 0 0 2px;
  }
  .app .banner-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 1;
  }
  .app .content-wrap {
    padding: 10px 12px 14px;
  }
  .print-timestamp { display: block !important; }
  .load-basic-calc .toolbar-wrap,
  .load-basic-calc .scenario-actions,
  .load-basic-calc .scenario-storage-note,
  .load-basic-calc .sort-bar,
  .load-basic-calc .search-wrap,
  .load-basic-calc .btn,
  .load-basic-calc .add-row,
  .load-basic-calc .col-delete,
  .load-basic-calc .toast-container,
  .load-basic-calc .help-icon,
  .load-basic-calc .help-popover,
  .load-basic-calc .equipment-list-heading,
  .load-basic-calc .export-format-dialog { display: none !important; }
  .load-basic-calc .scenario-section {
    display: block !important;
    /* Do not force a page break after Scenarios; let cards flow on the same page when space allows */
    page-break-after: auto;
    break-after: auto;
  }
  /* Print: stack summary/capacity/fuel cards above equipment (screen keeps 2-col grid). */
  .load-basic-calc .main-grid {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 0;
    margin-top: 0;
    grid-template-columns: unset;
  }
  .load-basic-calc .main-grid .sidebar {
    order: -1;
    width: 100%;
    max-width: 100%;
    /* Avoiding the whole sidebar caused a forced break after Scenarios when the block was taller than the remaining page. */
    page-break-inside: auto;
    break-inside: auto;
  }
  /* Keep each sidebar heading with the card that follows (help popover is hidden in print). */
  .load-basic-calc .sidebar .section-heading-row {
    page-break-after: avoid;
    break-after: avoid;
  }
  /* Prefer not to split individual cards; still allows breaks between card groups */
  .load-basic-calc .sidebar .card {
    page-break-before: avoid;
    break-before: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .load-basic-calc .main-grid .categories-wrap {
    order: 1;
  }
  .load-basic-calc .sidebar > .section-heading-row:first-child h2 {
    margin-top: 0;
  }
  /* Standalone root is .app (no .load-basic-calc); match print layout */
  .app .main-grid {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 0;
    margin-top: 0;
    grid-template-columns: unset;
  }
  .app .main-grid .sidebar {
    order: -1;
    width: 100%;
    max-width: 100%;
    page-break-inside: auto;
    break-inside: auto;
  }
  .app .sidebar .section-heading-row {
    page-break-after: avoid;
    break-after: avoid;
  }
  .app .sidebar .card {
    page-break-before: avoid;
    break-before: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .app .main-grid .categories-wrap {
    order: 1;
  }
  .app .sidebar > .section-heading-row:first-child h2 {
    margin-top: 0;
  }

  /* Print-only compression: sidebar cards + scenario notes (full text, no clipping) */
  .load-basic-calc .sidebar,
  .app .sidebar {
    font-size: 0.88rem;
  }
  .load-basic-calc .sidebar .section-heading-row h2,
  .app .sidebar .section-heading-row h2 {
    font-size: 1.05rem;
    line-height: 1.25;
    margin-top: 8px;
    margin-bottom: 0;
  }
  .load-basic-calc .sidebar .card,
  .app .sidebar .card {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: none;
  }
  .load-basic-calc .sidebar .fuel-card,
  .app .sidebar .fuel-card {
    margin-top: 8px;
  }
  .load-basic-calc .sidebar .card .row,
  .app .sidebar .card .row {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }
  .load-basic-calc .sidebar .card .value-lg,
  .app .sidebar .card .value-lg {
    font-size: 1.05rem;
  }
  .load-basic-calc .sidebar .capacity-head,
  .app .sidebar .capacity-head {
    margin-bottom: 4px;
  }
  .load-basic-calc .sidebar .capacity-fields,
  .app .sidebar .capacity-fields {
    gap: 6px;
    margin-top: 4px;
  }
  .load-basic-calc .sidebar .note,
  .app .sidebar .note {
    font-size: 0.7rem;
    line-height: 1.25;
    margin-top: 4px;
  }
  .load-basic-calc .sidebar .status-pill,
  .app .sidebar .status-pill {
    font-size: 0.65rem;
    padding: 3px 8px;
  }
  .load-basic-calc .scenario-meta,
  .app .scenario-meta {
    gap: 8px;
  }
  .load-basic-calc .scenario-meta .field textarea,
  .app .scenario-meta .field textarea {
    font-size: 0.85rem !important;
    line-height: 1.35 !important;
  }

  /* Print: white section/card backgrounds (toner) — match Consumables */
  .load-basic-calc .scenario-section,
  .app .scenario-section,
  .load-basic-calc .sidebar .card,
  .app .sidebar .card,
  .load-basic-calc .category,
  .app .category {
    background: #fff !important;
    box-shadow: none !important;
  }

  .load-basic-calc .category-body { display: block !important; }
  .load-basic-calc .category.collapsed .category-body { display: block !important; }
  .load-basic-calc input,
  .load-basic-calc textarea,
  .load-basic-calc select { border: none; background: transparent; }
}

/* Responsive */
@media (max-width: 900px) {
  .load-basic-calc .toolbar { justify-content: flex-start; }
  .load-basic-calc .scenario-actions { flex-direction: column; align-items: flex-start; }
  .load-basic-calc .scenario-meta { grid-template-columns: 1fr; }
  .load-basic-calc .main-grid { grid-template-columns: 1fr; }
}
